Optimal. Leaf size=56 \[ \frac {b (4 a+b) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {a^2 \sin (e+f x)}{f}+\frac {b^2 \sec (e+f x) \tan (e+f x)}{2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {4232, 398, 393,
212} \begin {gather*} \frac {a^2 \sin (e+f x)}{f}+\frac {b (4 a+b) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {b^2 \tan (e+f x) \sec (e+f x)}{2 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 393
Rule 398
Rule 4232
Rubi steps
\begin {align*} \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=\frac {\text {Subst}\left (\int \frac {\left (a+b-a x^2\right )^2}{\left (1-x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac {\text {Subst}\left (\int \left (a^2+\frac {b (2 a+b)-2 a b x^2}{\left (1-x^2\right )^2}\right ) \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac {a^2 \sin (e+f x)}{f}+\frac {\text {Subst}\left (\int \frac {b (2 a+b)-2 a b x^2}{\left (1-x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac {a^2 \sin (e+f x)}{f}+\frac {b^2 \sec (e+f x) \tan (e+f x)}{2 f}+\frac {(b (4 a+b)) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (e+f x)\right )}{2 f}\\ &=\frac {b (4 a+b) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {a^2 \sin (e+f x)}{f}+\frac {b^2 \sec (e+f x) \tan (e+f x)}{2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 80, normalized size = 1.43 \begin {gather*} \frac {2 a b \tanh ^{-1}(\sin (e+f x))}{f}+\frac {b^2 \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {a^2 \cos (f x) \sin (e)}{f}+\frac {a^2 \cos (e) \sin (f x)}{f}+\frac {b^2 \sec (e+f x) \tan (e+f x)}{2 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 69, normalized size = 1.23
method | result | size |
derivativedivides | \(\frac {a^{2} \sin \left (f x +e \right )+2 a b \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )+b^{2} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )}{f}\) | \(69\) |
default | \(\frac {a^{2} \sin \left (f x +e \right )+2 a b \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )+b^{2} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )}{f}\) | \(69\) |
risch | \(-\frac {i a^{2} {\mathrm e}^{i \left (f x +e \right )}}{2 f}+\frac {i a^{2} {\mathrm e}^{-i \left (f x +e \right )}}{2 f}-\frac {i b^{2} \left ({\mathrm e}^{3 i \left (f x +e \right )}-{\mathrm e}^{i \left (f x +e \right )}\right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}+\frac {2 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) a b}{f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) b^{2}}{2 f}-\frac {2 \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) a b}{f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) b^{2}}{2 f}\) | \(163\) |
norman | \(\frac {\frac {\left (2 a^{2}+b^{2}\right ) \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {\left (6 a^{2}-b^{2}\right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {\left (2 a^{2}+b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}-\frac {\left (6 a^{2}-b^{2}\right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{3}}-\frac {b \left (4 a +b \right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{2 f}+\frac {b \left (4 a +b \right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{2 f}\) | \(180\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 94, normalized size = 1.68 \begin {gather*} -\frac {b^{2} {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 4 \, a b {\left (\log \left (\sin \left (f x + e\right ) + 1\right ) - \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 4 \, a^{2} \sin \left (f x + e\right )}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.22, size = 101, normalized size = 1.80 \begin {gather*} \frac {{\left (4 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (4 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (2 \, a^{2} \cos \left (f x + e\right )^{2} + b^{2}\right )} \sin \left (f x + e\right )}{4 \, f \cos \left (f x + e\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2} \cos {\left (e + f x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.45, size = 79, normalized size = 1.41 \begin {gather*} \frac {4 \, a^{2} \sin \left (f x + e\right ) + {\left (4 \, a b + b^{2}\right )} \log \left ({\left | \sin \left (f x + e\right ) + 1 \right |}\right ) - {\left (4 \, a b + b^{2}\right )} \log \left ({\left | \sin \left (f x + e\right ) - 1 \right |}\right ) - \frac {2 \, b^{2} \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1}}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.11, size = 55, normalized size = 0.98 \begin {gather*} \frac {a^2\,\sin \left (e+f\,x\right )+\frac {b\,\mathrm {atanh}\left (\sin \left (e+f\,x\right )\right )\,\left (4\,a+b\right )}{2}-\frac {b^2\,\sin \left (e+f\,x\right )}{2\,\left ({\sin \left (e+f\,x\right )}^2-1\right )}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________